package org.eenie.appseed.ui.main

import android.view.View
import androidx.recyclerview.widget.RecyclerView

class BindingViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
    var bd: Any? = null
    inline fun <reified BD> binding(): BD {
        if (bd == null) {
            val clz = BD::class.java
            val method = clz.getDeclaredMethod("bind", View::class.java)
            bd = method.invoke(null, itemView)
        }
        return bd as BD
    }
}